<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    /* let num1 = 10;
    
    let num2 = 30;

    let num3 = num1 > num2? num1 : num2; 

    if (num1 > num2 || num1 < num2) {

        console.log(num1);
    } else {
        console.log(num2);
    } */

   /* let res = function () {

    setTimeout(() => {
        console.log("first")
    }, 3000);

   }

   let res2 = function () {

    setTimeout(() => {
        console.log("second")
    }, 1000);
   }

   let num1 = 10;

   let num2 = 20;

   let result = num1 > num2? res() : res2();
 */
   
  let obj = {

    name: "test",

    age: 18,

    sex: "male",
    
    friend: {
        name: "kobe",
        eating: function () {

            console.log("eat")
        }

    }
}

obj && obj.friend && obj.friend.eating &&obj.friend.eating();

</script>
</html>